package com.demo.service.impl;

import com.demo.dao.EmployeeDAO;
import com.demo.dao.impl.EmployeeDAOImpl;
import com.demo.service.EmployeeService;
import com.demo.bean.Employee;

import java.io.Serializable;
import java.util.Map;

/**
 * Employee模块的Service层（业务层）的具体实现类，对EmployeeService接口中定义的抽象方法作出具体的功能实现
 */
public class EmployeeServiceImpl implements EmployeeService {
    //@Override
    public void add(Employee vo) {
        EmployeeDAO employeeDAO = new EmployeeDAOImpl();
        employeeDAO.add(vo);
    }

    //@Override
    public void delete(long id) {
        EmployeeDAO employeeDAO = new EmployeeDAOImpl();
        employeeDAO.delete(id);
    }

    //@Override
    public void update(Employee vo) {
        EmployeeDAO employeeDAO = new EmployeeDAOImpl();
        employeeDAO.update(vo);
    }

    //@Override
    public Employee get(Serializable id) {
        EmployeeDAO employeeDAO = new EmployeeDAOImpl();
        return employeeDAO.get(id);
    }

    //@Override
    public Map<String, Object> list(Map<String, Object> params) {
        EmployeeDAO employeeDAO = new EmployeeDAOImpl();
        return employeeDAO.list(params);
    }
}
